// TOWN SCRIPT
//    Town 4

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

body;

beginstate INIT_STATE;
// Called upon entering
break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;
// Called every turn.
break;


//Stop them going back to previous town
beginstate 10;
	message_dialog("You've already explored that section of the caves; heading back there instead of pressing on doesn't make any sense.","");
	block_entry(1);
break;

beginstate 11;
	move_to_new_town(5,24,41);
break;

//intro
beginstate 12;
	if(get_flag(4,0) == 0) {
		message_dialog("You enter this large cavern - it is much larger than the previous ones you have passed through. Looking around, you spot two things of interest. First of all, there are two ruined buildings here - at one point these caves must have been inhabited.","The other thing you spot is what looks like a collection of nests, on top of a small hill. Whatever lives there isn't at home right now, fortunately, but they could return at any time.");
		set_flag(4,0,1);
	}
break;

//top of the hill
beginstate 13;
	if(get_flag(4,1) == 0) {
		message_dialog("You reach the top of this small hill and look around. Aside from the ruined buildings, and a small swamp which you failed to spot earlier, you don't see anything interesting.","Fortunately, you also don't see the owners of these nests, one of which you assume must be the beast you fought earlier. It looks like you'll be able to get through this area without fighting again.");
		set_flag(4,1,1);
	}
break;

//Bad shrooms
beginstate 14;
	message_dialog("You take a look at the plants growing here but don't spot anything that is useful for making healing potions.","You move on.");
break;

//claw claw claw
beginstate 15;
	if(get_flag(4,2) == 0) {
		message_dialog("As you get closer to the edge of this small pool of water you spot heavy claw-marks gouged into the rock - whatever lives here must use this pool regularly.","Interesting, maybe, but there's little you can do here. You move on.");
		set_flag(4,2,1);
	}
break;

//Box/chests
beginstate 16;
	message_dialog("This chest is completely empty, apart from a fine layer of dust. You close it up, and move on.","");
break;

//Exit west
beginstate 17;
	message_dialog("Another cavequake has made this tunnel impassable. You won't be able to explore any further in this direction.","");
	block_entry(1);
break;
